﻿using Chip8.Core.Bus;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Chip8.Core.Memory
{
	internal class RAM : Device
	{
		private const int RamSize = 4096;

		public RAM(SystemBus bus) 
			: base(bus)
		{

		}

		public override void Reset()
		{
			Array.Clear(_ram, 0, RamSize);
			//TODO: init font (0x50-)
		}

		public override void Tick()
		{
			
		}

		public byte this[ushort address]
		{
			get { return _ram[address]; }
			set { _ram[address] = value; }
		}

		private byte[] _ram = new byte[RamSize];
	}
}
